package com.xjtu.platform.security.register.Impl;

import com.xjtu.platform.security.register.CodeIdentService;
import com.xjtu.platform.security.register.RegisterDto;
import com.xjtu.platform.security.register.dao.CodeDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
@Transactional
public class CodeIdentServiceImpl implements CodeIdentService {

    @Resource
    private CodeDao codeDao;

    @Override
    public int getCode(RegisterDto registerDto) {
        try {
            return codeDao.getCode(registerDto);
        }catch (Exception e){
            e.printStackTrace();
            return 0;
        }
    }
}
